package com.fusetech.flow.audit.service.mapstruct;


import com.fusetech.flow.audit.domain.AuditProcessAuditorRoleUser;
import com.fusetech.flow.audit.service.dto.AuditProcessAuditorRoleUserDTO;
import com.fusetech.os.core.mapstruct.EntityWrapper;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 *  AuditProcessAuditorRoleUserWrapper
 * @author xx
 * @version 2023-05-06
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {} )
public interface AuditProcessAuditorRoleUserWrapper extends EntityWrapper<AuditProcessAuditorRoleUserDTO, AuditProcessAuditorRoleUser> {

    AuditProcessAuditorRoleUserWrapper INSTANCE = Mappers.getMapper(AuditProcessAuditorRoleUserWrapper.class);
     @Mappings({
            @Mapping(source = "auditProcess.id", target = "auditProcessId"),
            //@Mapping(source = "auditorRoleUser.id", target = "auditorRoleUserId"),
            @Mapping(source = "createBy.userId", target = "createBy"),
            @Mapping (source = "updateBy.userId", target = "updateBy")
     })
    AuditProcessAuditorRoleUser toEntity(AuditProcessAuditorRoleUserDTO dto);


    @Mappings({
            @Mapping(source = "auditProcessId", target = "auditProcess.id"),
            //@Mapping(source = "auditorRoleUserId", target = "auditorRoleUser.id"),
            @Mapping (source = "createBy", target = "createBy.userId"),
            @Mapping (source = "updateBy", target = "updateBy.userId")
    })
    AuditProcessAuditorRoleUserDTO toDTO(AuditProcessAuditorRoleUser entity);
}

